package main

import (
	controller "github.com/test/src/github.com/http/controller"
	filter "github.com/test/src/github.com/http/filter"
	"net/http"
)

func main() {
	server1()
}

func server1() {
	http.HandleFunc("/logout", filter.Log(controller.Logout))
	http.HandleFunc("/login", filter.Log(controller.LoginHandle))
	http.HandleFunc("/user-info", filter.Secure(filter.Log(controller.UserInfoHandle)))
	http.HandleFunc("/", filter.Log(controller.Index))
	http.ListenAndServe(":8080", nil)
}

func server2() {
	mux := http.NewServeMux()
	files := http.FileServer(http.Dir("D://files"))
	mux.Handle("/static/", http.StripPrefix("/static/", files))

	server := http.Server{
		Addr:    ":8080",
		Handler: mux,
	}
	server.ListenAndServe()
}
